package cc.eddic.practice.spring.dto;

import cc.eddic.practice.spring.domain.Category;
import cc.eddic.practice.spring.domain.Question;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.val;
import org.springframework.beans.BeanUtils;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class QuestionResponse {
    private String description;
    private Long id;

    public static QuestionResponse from(final Question question){
        val dto=new QuestionResponse();
        BeanUtils.copyProperties(question,dto);
        return dto;
    }
}
